﻿//该文件专门创建这个应用的路由器

//你得求vue-router
import VueRouter from 'vue-router'//可以当成构造函数去用
//引入组件
import About from '@/pages/About'
import Home from '../pages/Home.vue'
import News from '../pages/News.vue'

import Messgae from '../pages/Message.vue'
import Detil from '../pages/Detil.vue'


//创建并暴露一个路由器
export default new VueRouter({
    //怎么配置?对应关系就是路径(key)和组件(value)
    routes:[
        {
            //第一组路由规则
            path:'/about',
            component:About
        },
        {
            path:'/home',
            component:Home,
            children:[
                {
                    path:'news',
                    component:News,
                },
                {
                    path:'message',
                    component:Messgae,
                    children:[
                        {
                            path:"detil",
                            component: Detil,
                        }
                    ]
                }
            ]
        },

    ]
})

